#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.68])
AC_INIT(XmlCppClassGenerator, 1.0, johan.luisier@gmail.com)
AM_INIT_AUTOMAKE( [1.0] )

AC_CONFIG_MACRO_DIR( ./ )

AC_ARG_ENABLE( local,
	       AS_HELP_STRING( [--enable-local], [Enable local installation] ) )

if test x"$enable_local" = x"yes" ; then
   echo "Local installation requested."
   AC_SUBST( LOCAL_ENABLE, yes )
else
   AC_SUBST( LOCAL_ENABLE, no )
fi

# Checks for programs.

AM_PATH_PYTHON( 2.7 )
AC_CHECK_PROG( HAS_XMLLINT, xmllint, yes, no, $PATH )

if test x"$HAS_XMLLINT" != x"yes" ; then
   AC_MSG_ERROR( [Please install xmllint (provided by libxml2) before installing.] )
fi

# Checks for libraries.

AC_PYTHON_MODULE( xml.dom )
AC_PYTHON_MODULE( codecs )
AC_PYTHON_MODULE( subprocess )
AC_PYTHON_MODULE( argparse )

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES( Makefile )
AC_OUTPUT

if test x"$enable_local" = x"yes" ; then
   echo "Run make and you're done"
else
   echo "Run make and make install, then you're done"
fi
